﻿using MagicKey.Components.AccessManager;
using MagicKey.Components.Database;
using MagicKey.Components.FileAccess;
using MagicKey.Components.UserManager;
using MagicKey.Interfaces;

namespace MagicKey.AppService
{
    public class MagicKey : IMagicKey
    {
        #region Members

        private readonly IAccessManager _accessManager;
        private readonly IFileAccess _fileAccess;
        private readonly IUserManager _userManager;
        private IDatabase _database;

        #endregion

        #region Constructor

        public MagicKey()
        {
            _fileAccess = new FileAccess();
            _accessManager = new AccessManager();
            _userManager = new UserManager();
        }

        #endregion

        #region Methods

        public IFileAccess GetFileAccess()
        {
            return _fileAccess;
        }

        public IDatabase GetDatabase()
        {
            _database = new MagicDatabase();
            return _database;
        }

        public IAccessManager GetAccessManager()
        {
            return _accessManager;
        }

        public IUserManager GetUserManager()
        {
            return _userManager;
        }

        #endregion
    }
}